<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddColumnSourceFileUrlInVersionTable extends AbstractMigration
{
    public function up()
    {
        $this->table('version')
            ->addColumn('source_file_url', 'text', ['null' => true, 'comment' => '源文件上传地址'])
            ->addColumn('source_file_password', 'text', ['null' => true, 'comment' => '源文件解压密码'])
            ->addColumn('source_file_is_download', 'enum', ['values' => 'yes,no', 'default' => 'no', 'comment' => '源文件是否下载'])
            ->save();
    }

    public function down()
    {
        $this->table('version')
            ->removeColumn('source_file_url')
            ->removeColumn('source_file_password')
            ->removeColumn('source_file_is_download')
            ->save();
    }
}
